import { createI18n } from 'vue-i18n'
import en from './en.js'
import ja from './ja.js'
import zh_cn from './zh-cn.js'
import zh_tw from './zh-tw.js'

const messages = {
  en,
  ja,
  'zh-cn': zh_cn,
  'zh-tw': zh_tw
}

const i18n = createI18n({
  fallbackLocale: 'en',
  legacy: false, // 设置为 false，启用 composition API 模式
  locale: localStorage.getItem('localeLang') || 'zh-cn',
  messages
})
export { i18n }
